#include "stdafx.h"

#include "orsBase/orsIPlatform.h"

ORS_GET_UTILITY_SERVICE_IMPL();
ORS_GET_IMAGE_SERVICE_IMPL();
ORS_GET_MATRIX_SERVICE_IMPL();

//////////////////////////////////////////////////////////////////////////

#include "orsImage/orsIExeImageSourceHelper.h"

#include "orsImage/orsIExeImageFusion.h"

#include "orsAlgIHSFusion.h"
#include "orsAlgBroveyFusion.h"
#include "orsAlgMultiplyFusion.h"
#include "orsAlgPCAFusion.h"
#include "orscuAlgIHSFusion.h"

orsIObject* createCuAlgIHSFusion(bool bForRegister)
{
	return new orsCuAlgIHSFusion(  );
}

orsIObject* createAlgIHSFusion(bool bForRegister)
{
	return new orsAlgIHSFusion(  );
}

orsIObject* createAlgBroveyFusion(bool bForRegister)
{
	return new orsAlgBroveyFusion(  );
}

orsIObject* createAlgMultiplicativeFusion(bool bForRegister)
{
	return new orsAlgMultiplicativeFusion(  );
}


orsIObject* createAlgPCAFusion(bool bForRegister)
{
	return new orsAlgPCAFusion(  );
}




#include "orsXImageSourceFusion.h"

ORS_EXE_IMP2( orsXImageSourceFusion, ORS_ALG_IMAGE_FUSION_IHS, orsSE_IHSFusion, orsISE_ImageFusion, "process.IHS", "IHS Image Fusion", "IHS Image Fusion" );
ORS_EXE_IMP2( orsXImageSourceFusion, ORS_ALG_IMAGE_FUSION_BROVEY, orsSE_BroveyFusion, orsISE_ImageFusion, "process.Brovey", "Brovey Image Fusion", "Brovey Image Fusion" );
ORS_EXE_IMP2( orsXImageSourceFusion, ORS_ALG_IMAGE_FUSION_MULTIPLICATIVE, orsSE_MultiplicativeFusion, orsISE_ImageFusion, "process.Multiplicative", "Multiplicative Image Fusion", "Multiplicative Image Fusion" );
ORS_EXE_IMP2( orsXImageSourceFusion, ORS_ALG_IMAGE_FUSION_PCA, orsSE_PCAFusion, orsISE_ImageFusion, "process.PCA", "PCA Image Fusion", "PCA Image Fusion" );
ORS_EXE_IMP2( orsXImageSourceFusion, ORS_ALG_CUDA_IMAGE_FUSION_IHS, orsSE_CudaIHSFusion, orsISE_ImageFusion, "process.CudaIHS", "Cuda IHS Image Fusion", "Cuda IHS Image Fusion" );



orsIObject* createImageSourceFusion( bool bForRegister)
{
 	return new orsXImageSourceFusion( bForRegister );
}

orsIObject* createExeIHSFusion(bool bForRegister)
{
	return new orsSE_IHSFusion( bForRegister );
}
 
orsIObject* createExeCudaIHSFusion(bool bForRegister)
{
	return new orsSE_CudaIHSFusion( bForRegister );
}

orsIObject* createExeBroveyFusion(bool bForRegister)
{
	return new orsSE_BroveyFusion( bForRegister );
}
 
orsIObject* createExeMultiplicativeFusion(bool bForRegister)
{
	return new orsSE_MultiplicativeFusion( bForRegister );
}
 
orsIObject* createExePCAFusion(bool bForRegister)
{
	return new orsSE_PCAFusion( bForRegister );
}
 

class orsXPluginFusion: public orsIPlugin
{
public:
	virtual const orsChar *getID()	
	{
		return "org.openRS.imagefusion"; 
	};

	virtual	const orsChar *getName()	
	{	
		return "image Fusion"; 
	};
	
	virtual const orsChar *getProvider() 
	{	
		return "edu.whu.liesmars"; 
	};
	
	virtual const orsChar *getVersion()
	{
		return "0.1";
	}
	
	virtual  bool initialize(orsIPlatform*  platform)
	{		
		orsIRegisterService *pRegister = platform->getRegisterService();

		
		pRegister->registerObject( createAlgIHSFusion );
		pRegister->registerObject( createAlgBroveyFusion );
		pRegister->registerObject( createAlgMultiplicativeFusion );
		pRegister->registerObject( createAlgPCAFusion );
		pRegister->registerObject( createCuAlgIHSFusion);
 		pRegister->registerObject( createImageSourceFusion );

 		pRegister->registerObject( createExeIHSFusion );
 		pRegister->registerObject( createExeBroveyFusion );
		pRegister->registerObject( createExeMultiplicativeFusion );
		pRegister->registerObject( createExePCAFusion );
		pRegister->registerObject(createExeCudaIHSFusion);
		return true;
	}
	
	virtual void finalize()
	{
		
	}
};

ORS_REGISTER_PLUGIN( orsXPluginFusion )

